#ifndef SETTING_H
#define SETTING_H

#include <QtGui/QDialog>
#include <QList>
#include <QPlainTextEdit>
#include <QRadioButton>
#include <QCheckBox>

#include "Define.h"
#include "FileSelect.h"

namespace Ui {
    class Setting;
}

class Setting : public QDialog {
    Q_OBJECT

	public:
		Setting(QWidget *parent = 0);
		~Setting();
		bool Initialize();

	protected:
		void changeEvent(QEvent *e);

	private:
		void InitWidget();
//		void SaveToFile(QString fileName, QString backupName, const char *data);

	private slots:
		void on_checkBox_clicked(bool checked);
  void on_pushButton_clicked();
		void on_pushButton_deleteLog_clicked();
		void on_pushButton_logdir_clicked();
		void on_button_cancel_clicked();
		void on_button_save_clicked();
		void OnDownloadDirectorySelected(QString dirPath);

	private:
		Ui::Setting *m_ui;
		QPlainTextEdit *_textEdits[4][3];
		QRadioButton *_groups[6];
		QCheckBox *_checkboxs[4];
		FileSelect _fileSelect;

	signals:
		void sigNetworkConfigChanged(int prePort, QString groupName);
		void sigLogDeleted();
};

#endif // SETTING_H
